<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>jquery 网页二维码生成</title>
    <script type="text/javascript" src="js/jquery.min.js"></script> 
    <script type="text/javascript" src="js/jquery.qrcode.min.js"></script> 
    <style type="text/css">
    	html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,menu,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,input,label,textarea,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;outline:0;word-break:break-all;word-wrap:break-word;box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-appearance:none;}
		html{min-height:100%;-webkit-text-size-adjust:none;overflow-x:hidden;}
		body{min-width:320px;min-height:100%;margin:0 auto;color:#666;font:1rem/2rem MICROSOFT YaHei,Helvetica,Tahoma,sans-serif;-webkit-user-select:none;}
		.mb40{margin-bottom: 40px;}
    	.header{height: 3rem; line-height: 3rem; font-size: 1.2rem; text-align: center; color: #fff; background:#4ab4f0;}
    	#code{text-align: center}
    </style>
</head>
<body>
<header class="header mb40">网页二维码自动生成</header>
<div id="code"></div>
<script>
	var url = window.location.href;
	$("#code").qrcode({ 
	    render: "canvas", 	//table方式 , //canvas方式
	    width: 200, 		//宽度 
	    height:200, 		//高度 
	    text: url 			//任意内容 
	});
</script>
</body>
</html>